import React, { Component } from 'react'

export default class List extends Component {
  render () {
    const { todos, delTodos } = this.props
    return (
      <div>
        <ul>
          {todos.map((item, index) => <li key={item.id}>
            {item.task}
            <button>修改</button>
            <button onClick={() => { delTodos(index) }}>删除</button>
          </li>)}
        </ul>
      </div>
    )
  }
}
